package com.cmwa.solution.business.myHome.todo.entity;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.type.Alias;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.cmwa.solution.base.entity.BaseVo;
import com.cmwa.solution.utils.cached.DictionaryCached;
import com.cmwa.solution.utils.cached.EmployeeCached;
import com.cmwa.solution.utils.spring.DateYMDJsonSerializer;

/**
 * 待办表实体
 * 
 * @author ex-zuotc
 * @date 2019-01-30 18:23:07
 */
@Alias("todoVo")
public class TodoVo extends BaseVo {

	/**
	 * 主键，SEQ_TODO
	 */
	private String id;

	/**
	 * 管理人公司
	 */
	private String manageCompany;
	
	/**
	 * 管理人名称
	 */
	private String companyName;

	/** 服务类型 */
	private String serviceType;
	
	/** 服务类型名称 */
	private String serviceTypeName;
	
	/**
	 * 待办类型
	 */
	private String todoType;

	/**
	 * 待办类型名称
	 */
	private String todoTypeName;

	/**
	 * 待办日期
	 */
	private Date todoDate;

	/**
	 * 系列产品编号
	 */
	private String prjCode;
	
	/** 产品名称 */
	private String prjSname;
	
	/** 产品代码 */
	private String outerId;

	/**
	 * 材料类型
	 */
	private String fileType;

	/**
	 * 材料类型名称
	 */
	private String fileTypeName;

	/**
	 * 状态
	 */
	private String status;

	/**
	 * 上传人
	 */
	private String uploader;
	
	/**
	 * 上传时间
	 */
	private String uploadTime;

	/**
	 * 确认人
	 */
	private String confirmer;
	
	/**
	 * 确认时间
	 */
	private String confirmTime;
	/**
	 * 完成人
	 */
	private String endId;
	
	/**
	 * 完成时间
	 */
	private String endTime;

	/**
	 * 创建人
	 */
	private String createId;

	/**
	 * 创建时间
	 */
	private String createTime;

	/**
	 * 修改人
	 */
	private String modifyId;

	/**
	 * 修改时间
	 */
	private String modifyTime;
	
	/** 无材料上传 */
	private String noFile;
	
	/** 附件ID */
	private String attId;
	
	private String postPersonnelId;
	
	private String postPersonnelNm;
	
	private String empTelOff;
	

	public String getAttId() {
		return attId;
	}

	public void setAttId(String attId) {
		this.attId = attId;
	}

	/**
	 * 主键，SEQ_TODO
	 */
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getNoFile() {
		return noFile;
	}

	public void setNoFile(String noFile) {
		this.noFile = noFile;
	}

	/**
	 * 管理人公司
	 */
	public String getManageCompany() {
		return manageCompany;
	}

	public void setManageCompany(String manageCompany) {
		this.manageCompany = manageCompany;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getServiceType() {
		return serviceType;
	}

	public void setServiceType(String serviceType) {
		this.serviceType = serviceType;
	}

	public String getServiceTypeName() {
		if (StringUtils.isNotEmpty(serviceType)) {
			return DictionaryCached.getDictName("SERVICE_TYPE", serviceType);
		}
		return serviceTypeName;
	}

	public void setServiceTypeName(String serviceTypeName) {
		this.serviceTypeName = serviceTypeName;
	}

	/**
	 * 待办类型
	 */
	public String getTodoType() {
		return todoType;
	}

	public void setTodoType(String todoType) {
		this.todoType = todoType;
	}

	/**
	 * 待办日期
	 */
	@JsonSerialize(using = DateYMDJsonSerializer.class)
	public Date getTodoDate() {
		return todoDate;
	}

	public void setTodoDate(Date todoDate) {
		this.todoDate = todoDate;
	}

	/**
	 * 产品编号
	 */
	public String getPrjCode() {
		return prjCode;
	}

	public void setPrjCode(String prjCode) {
		this.prjCode = prjCode;
	}

	/**
	 * 材料类型
	 */
	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	/**
	 * 状态
	 */
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	/**
	 * 上传人
	 */
	public String getUploader() {
		return uploader;
	}

	public void setUploader(String uploader) {
		this.uploader = uploader;
	}

	/**
	 * 上传时间
	 */
	public String getUploadTime() {
		return uploadTime;
	}

	public void setUploadTime(String uploadTime) {
		this.uploadTime = uploadTime;
	}

	/**
	 * 确认人
	 */
	public String getConfirmer() {
		return confirmer;
	}

	public void setConfirmer(String confirmer) {
		this.confirmer = confirmer;
	}

	/**
	 * 确认时间
	 */
	public String getConfirmTime() {
		return confirmTime;
	}

	public void setConfirmTime(String confirmTime) {
		this.confirmTime = confirmTime;
	}

	/**
	 * 创建人
	 */
	public String getCreateId() {
		return createId;
	}

	public void setCreateId(String createId) {
		this.createId = createId;
	}

	/**
	 * 创建时间
	 */
	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	/**
	 * 修改人
	 */
	public String getModifyId() {
		return modifyId;
	}

	public void setModifyId(String modifyId) {
		this.modifyId = modifyId;
	}

	/**
	 * 修改时间
	 */
	public String getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(String modifyTime) {
		this.modifyTime = modifyTime;
	}

	public String getTodoTypeName() {
		if (StringUtils.isNotEmpty(todoType)) {
			return DictionaryCached.getDictName("TODO_TYPE", "TODO_TYPE", serviceType, todoType);
		}
		return todoTypeName;
	}

	public void setTodoTypeName(String todoTypeName) {
		this.todoTypeName = todoTypeName;
	}

	public String getFileTypeName() {
		if (StringUtils.isNotEmpty(fileType)) {
			return DictionaryCached.getDictName("TODO_FILE_TYPE", fileType);
		}
		return fileTypeName;
	}

	public void setFileTypeName(String fileTypeName) {
		this.fileTypeName = fileTypeName;
	}

	@Override
	public String getStatusNm() {
		if (StringUtils.isNotEmpty(status)) {
			return DictionaryCached.getDictName("TODO_STATUS", status);
		}
		return status;
	}

	public String getUploaderName() {
		return EmployeeCached.getName(uploader);
	}
	public String getEndName() {
		return EmployeeCached.getName(endId);
	}

	public String getConfirmerName() {
		return EmployeeCached.getName(confirmer);
	}

	public String getPrjSname() {
		return prjSname;
	}

	public void setPrjSname(String prjSname) {
		this.prjSname = prjSname;
	}

	public String getOuterId() {
		return outerId;
	}

	public void setOuterId(String outerId) {
		this.outerId = outerId;
	}

	public String getEndId() {
		return endId;
	}

	public void setEndId(String endId) {
		this.endId = endId;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getPostPersonnelId() {
		return postPersonnelId;
	}

	public void setPostPersonnelId(String postPersonnelId) {
		this.postPersonnelId = postPersonnelId;
	}

	public String getPostPersonnelNm() {
		if (StringUtils.isNotBlank(postPersonnelId)) {
			return EmployeeCached.getAllName(postPersonnelId);
		}
		return postPersonnelNm;
	}

	public void setPostPersonnelNm(String postPersonnelNm) {
		this.postPersonnelNm = postPersonnelNm;
	}

	public String getEmpTelOff() {
		if (StringUtils.isNoneBlank(postPersonnelId)) {
			return EmployeeCached.getFirstEmpTelOff(postPersonnelId);
		}
		return empTelOff;
	}

	public void setEmpTelOff(String empTelOff) {
		this.empTelOff = empTelOff;
	}
	
}
